extends Control


var data

var map_data

signal go_map(map_data, npc_data)


func _ready():
	pass # Replace with function body.



func set_data(npc_data):
	self.data = npc_data
	$id.text = str(npc_data["id"])
	$name.text = npc_data.get("name", "")
	
	$name.hint_tooltip = "坐标: (%d,%d)" %[npc_data["x"], npc_data["y"]]
	
	map_data = DataSource.get_data_by_one(DataSource.map_register, npc_data["mapId"])
	
	if map_data:
		$map.text = map_data["name"]
	else:
		$map.text = "--"
		$map.modulate = "ff0000"
	

	 
func _on_map_button_up():
	emit_signal("go_map", map_data, data)
	
